#include "colors.inc"    // The include files contain
#include "stones.inc"    // pre-defined scene elements
                                                        
#include "textures.inc"    // pre-defined scene elements
#include "shapes.inc"
#include "glass.inc"
#include "metals.inc"
#include "woods.inc"   


#declare ROAD_WIDTH = 5;
#declare ROUNADABOUT_INTERNAL_RADIUS = 3;
#declare ROUNADABOUT_RADIUS = ROUNADABOUT_INTERNAL_RADIUS + ROAD_WIDTH;
#declare ROAD_HEIGHT = 0.1;
#declare GROUND_HEIGHT = 0;
#declare DISTANCE_BETWEEN_PARALLEL_ROADS = 1;
#declare HALF_DISTANCE_BETWEEN_PARALLEL_ROADS = DISTANCE_BETWEEN_PARALLEL_ROADS/2;
#declare SCENE_EXTENT = 200;

background { color Green }


camera {
    location <5, 30, -30>
    look_at  <0, 0,  0>
}




difference {
    torus {
      ROUNADABOUT_RADIUS, ROAD_WIDTH/2
    }
    box { <-SCENE_EXTENT, SCENE_EXTENT, -SCENE_EXTENT>, <SCENE_EXTENT, ROAD_HEIGHT, SCENE_EXTENT> }
    box { <-SCENE_EXTENT, -SCENE_EXTENT, -SCENE_EXTENT>, <SCENE_EXTENT, GROUND_HEIGHT, SCENE_EXTENT> }
    pigment { Gray50 }
}

#declare roads = union{

box { <-SCENE_EXTENT, ROAD_HEIGHT, ROAD_WIDTH>, <SCENE_EXTENT, GROUND_HEIGHT, HALF_DISTANCE_BETWEEN_PARALLEL_ROADS> }

box { <-SCENE_EXTENT, ROAD_HEIGHT, -HALF_DISTANCE_BETWEEN_PARALLEL_ROADS>, <SCENE_EXTENT, GROUND_HEIGHT, -ROAD_WIDTH> }

box { <ROAD_WIDTH, ROAD_HEIGHT, -SCENE_EXTENT>, <HALF_DISTANCE_BETWEEN_PARALLEL_ROADS, GROUND_HEIGHT, SCENE_EXTENT> }

box { <-HALF_DISTANCE_BETWEEN_PARALLEL_ROADS, ROAD_HEIGHT, -SCENE_EXTENT>, <-ROAD_WIDTH, GROUND_HEIGHT, SCENE_EXTENT> }

}

difference{
   object {roads}
   sphere{<0,0,0>,ROUNADABOUT_RADIUS}
   pigment { color Gray50 }
}



light_source { <2, 4, -3> color White}





    